﻿<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Addmin/BackEnd/MTP_Admin.Master" CodeBehind="BC_DSBH_NV.aspx.cs" Inherits="Bussiness.View.BackEnd.BC_DSBH_NV" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    


                    <ext:Panel ID="Panel2" runat="server" Title="Quản lý doanh bán hàng của nhân viên" PaddingSummary="10px 5px 0 5px">
                     <Items>
                                <ext:FieldSet ID="FieldSet1" runat="server" Layout="ColumnLayout" Title="Thông tin tìm kiếm"
                                    PaddingSummary="10px 5px 0 5px" Height="120">
                                    <Items>
                                        <ext:Container ID="Container2" runat="server" LabelAlign="Right" Layout="FormLayout"
                                            ColumnWidth=".5">
                                            <Items>
                                                 <ext:SelectBox ID="DSNV_SelectBox" runat="server" FieldLabel="Chọn nhân viên" AnchorHorizontal="100%"
                                                DataIndex="Status" IDMode="Static" ValueField="User1" DisplayField="Name" AllowBlank="false">
                                                <Store>
                                                    <ext:Store ID="DSNV_Store" runat="server">
                                                        <Reader>
                                                            <ext:ArrayReader IDProperty="User1">
                                                                <Fields>
                                                                    <ext:RecordField Name="User1" Type="String" Mapping="User1" />
                                                                    <ext:RecordField Name="Name" Type="String" Mapping="Name" />
                                                                </Fields>
                                                            </ext:ArrayReader>
                                                        </Reader>
                                                    </ext:Store>
                                                </Store>
                                            </ext:SelectBox>
                                            </Items>
                                            <Items>
                                                 <ext:SelectBox ID="Thang_SelectBox" runat="server" FieldLabel="Chọn tháng" AnchorHorizontal="100%"
                                                DataIndex="Status" IDMode="Static" AllowBlank="false">
                                                    <Items>
                                                        <ext:ListItem Text="1" Value="1"/>
                                                        <ext:ListItem Text="2" Value="2"/>
                                                        <ext:ListItem Text="3" Value="3"/>
                                                        <ext:ListItem Text="4" Value="4"/>
                                                        <ext:ListItem Text="5" Value="5"/>
                                                        <ext:ListItem Text="6" Value="6"/>
                                                        <ext:ListItem Text="7" Value="7"/>
                                                        <ext:ListItem Text="8" Value="8"/>
                                                        <ext:ListItem Text="9" Value="9"/>
                                                        <ext:ListItem Text="10" Value="10"/>
                                                        <ext:ListItem Text="11" Value="11"/>
                                                        <ext:ListItem Text="12" Value="12"/>
                                                        <ext:ListItem Text="Cả năm" Value="13"/>
                                                    </Items>
                                                </ext:SelectBox>
                                                </Items>
                                        </ext:Container>
                                        <ext:Container ID="Container3" runat="server" LabelAlign="Right" Layout="FormLayout"
                                            ColumnWidth=".5">
                                            <Items>
                                                <ext:Button ID="Button3" runat="server" Text="Tìm kiếm" FieldLabel=" " LabelSeparator=" "
                                                    Icon="Find">
                                                    <DirectEvents >
                                                        <Click OnEvent="Search" Before="validate"></Click>
                                                    </DirectEvents>
                                                </ext:Button>
                                            </Items>
                                        </ext:Container>
                                    </Items>
                                </ext:FieldSet>
                            </Items>
                            <Items>
                             <ext:GridPanel ID="DSBH_Grid" IDMode="Static" runat="server" Height="300" AutoScroll="true"
                                    Region="Center" Title=" ">
                                    <Store>
                                        <ext:Store ID="DSBH_Store" runat="server" AutoDataBind="true" SkipIdForNewRecords="false">
                                            <Reader>
                                                <ext:JsonReader IDProperty="ID">
                                                    <Fields>
                                                        <ext:RecordField Name="ID" Type="String" Mapping="ID" />
                                                        <ext:RecordField Name="NameCus" Type="String" Mapping="NameCus" />
                                                        <ext:RecordField Name="PhoneCus" Type="String" Mapping="PhoneCus" />
                                                        <ext:RecordField Name="CountProduct" Type="Int" Mapping="CountProduct" />
                                                        <ext:RecordField Name="TotalPrice" Type="Int" Mapping="TotalPrice" />
                                                        <ext:RecordField Name="Date" Type="Date" Mapping="Date" />
                                                    </Fields>
                                                </ext:JsonReader>
                                            </Reader>
                                        </ext:Store>
                                    </Store>
                                    <ColumnModel ID="ColumnModel2" runat="server" AutoDataBind="true">
                                        <Columns>
                                            <ext:RowNumbererColumn />
                                            <ext:Column ColumnID="ID" Header="Mã" DataIndex="ID" Hidden="true" />
                                            <ext:Column Header="Khách hàng" DataIndex="NameCus" AutoDataBind="true" Width="200"
                                                MenuDisabled="True" />
                                            <ext:Column Header="Số điện thoại" DataIndex="PhoneCus" AutoDataBind="true" Width="150" />
                                            <ext:NumberColumn Header="Số lượng SP" DataIndex="CountProduct" AutoDataBind="true"
                                                Width="90" MenuDisabled="True" />
                                            <ext:NumberColumn Header="Tổng tiền" DataIndex="TotalPrice" AutoDataBind="true" MenuDisabled="True"
                                                Format="0,00" />
                                            <ext:DateColumn Header="Ngày bán" DataIndex="Date" AutoDataBind="true" MenuDisabled="True"
                                                Format="dd/MM/yyyy" />
                                            <ext:CommandColumn Header="Action">
                                                <Commands>
                                                    <ext:GridCommand Icon="Delete" CommandName="Delete" ToolTip-Text="Xóa">
                                                    </ext:GridCommand>
                                                    <ext:CommandSeparator />
                                                    <ext:GridCommand Icon="NoteEdit" CommandName="Edit" ToolTip-Text="Sửa/Xem" />
                                                </Commands>
                                            </ext:CommandColumn>
                                        </Columns>
                                    </ColumnModel>
                                    <BottomBar>
                                        <ext:PagingToolbar ID="PagingToolBar1" runat="server" PageSize="10" StoreID="DSBH_Store"
                                            DisplayInfo="false" />
                                    </BottomBar>
                                    <SelectionModel>
                                        <ext:RowSelectionModel runat="server" ID="RowSelectionModel1">
                                        </ext:RowSelectionModel>
                                    </SelectionModel>
                                    <Listeners>
                                        <Command Handler="detail(command, record.data.ID)" />
                                    </Listeners>
                                </ext:GridPanel>
                             </Items>
                                
                                
                                <Buttons>
                                <ext:Button runat="server" Text="In bảng kê" ID="them" Icon="Printer">
                                    <Listeners>
                                      
                                    </Listeners>
                                </ext:Button>
                               
                            </Buttons>
                                </ext:Panel>
                  

<script type="text/javascript">
    function validate() {
        if (Ext.getCmp('Thang_SelectBox').getValue() == "" || Ext.getCmp('Thang_SelectBox').getValue() == null) {
            Ext.Msg.alert('Lỗi', 'Bạn phải chọn tháng');
            return false;
        }
        if (Ext.getCmp('DSNV_SelectBox').getValue() == "" || Ext.getCmp('DSNV_SelectBox').getValue() == null) {
            Ext.Msg.alert('Lỗi', 'Bạn phải chọn nhân viên');
            return false;
        }
    }

</script>
</asp:Content>